<div class="layui-card-body">
    <form class="layui-form" action="{:url()}"  method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">缺陷名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" value="{$info.title|default=''}" class="layui-input" autocomplete="off"
                       placeholder="不要超过32个汉字">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">缺陷开始时间</label>
            <div class="layui-input-inline">
                <input type="text" name="s_time" value="{$info.s_time|default=''}" class="layui-input"
                       autocomplete="off" lay-verify="required" placeholder="" id="s_time" readonly>
            </div>
            <label class="layui-form-label">缺陷结束时间</label>
            <div class="layui-input-inline">
                <input type="text" name="e_time" value="{$info.e_time|default=''}" class="layui-input"
                       autocomplete="off" lay-verify="required" placeholder="" id="e_time" readonly>
            </div>
        </div>
        <div class="layui-form-item">

            <label class="layui-form-label">实际时间</label>
            <div class="layui-input-inline">
                <input type="text" value="{$info.w_time|default='0'}" class="layui-input"
                       autocomplete="off" lay-verify="required" id="w_time" placeholder="单位小时">
            </div>
            <label class="layui-form-label">计划时间</label>
            <div class="layui-input-inline">
                <input type="text" value="{$info.p_time|default='0'}" class="layui-input"
                       autocomplete="off" lay-verify="required" id="p_time" placeholder="单位小时">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">缺陷状态</label>
            <div class="layui-input-inline">
                <select name="status" lay-search>
                    <volist name="bug_status" id="vo" key="k">
                        <option value="{$k}"
                        <notempty name="info.status">
                            <eq name="$k" value="$info.status">selected="selected"</eq>
                        </notempty>
                        > {$vo} </option>
                    </volist>
                </select>
            </div>
            <label class="layui-form-label">完成人员</label>
            <div class="layui-input-inline">
                <select name="touid" lay-search>
                    <volist name="userlist" id="vo" key="k">
                        <option value="{$vo.id}"
                        <notempty name="info.status">
                            <eq name="$vo.id" value="$info.uid">selected="selected"</eq>
                        </notempty>
                        > {$vo.nickname} </option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">任务等级</label>
            <div class="layui-input-inline">
                <select name="level_id" lay-search>
                    <volist name="level_status" id="vo" key="k">
                        <option value="{$k}"
                        <notempty name="info.status">
                            <eq name="$k" value="$info.level_id">selected="selected"</eq>
                        </notempty>
                        > {$vo} </option>
                    </volist>
                </select>
            </div>
            <label class="layui-form-label">缺陷来源</label>
            <div class="layui-input-inline">
                <select name="bug_source" lay-search>
                    <volist name="bug_source" id="vo" key="k">
                        <option value="{$k}"
                        <notempty name="info.status">
                            <eq name="$k" value="$info.bug_source">selected="selected"</eq>
                        </notempty>
                        > {$vo} </option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">详情</label>
            <div class="layui-input-block">
                <div id="info">
                    <p>{$info.info|raw|default=""}</p>
                </div>
                <textarea name="info" id="newinfo" style="display: none">{$info.info|raw|default=""}</textarea>
            </div>
        </div>
        <input type="hidden" name="project_id" value="{$info.project_id|default=''}">
        <input type="hidden" name="id" value="{$info.id|default=''}">
        <input type="hidden" name="info_id" value="{$info.info_id|default=''}">
    </form>

</div>
<link rel="stylesheet" href="https://cdn.weibuyun.com/static/admin/plugins/formSelects-v4.css">
<script charset="utf-8" src="https://cdn.weibuyun.com/static/admin/plugins/wangeditor/wangEditor.min.js"></script>
<script type="text/javascript">
    layui.use(['form', 'layer', 'formSelects', 'upload'], function () {
        var form = layui.form
            , formSelects = layui.formSelects
            , $ = layui.$
            , upload = layui.upload
            , laydate = layui.laydate;

        laydate.render({
            elem: '#s_time'

        });
        laydate.render({
            elem: '#e_time'

        });
        var E = window.wangEditor
        var editor = new E('#info')
        // 或者 var editor = new E( document.getElementById('editor') )
        editor.customConfig.menus = [
            'head',  // 标题
            'bold',  // 粗体
            'fontSize',  // 字号
            'fontName',  // 字体
            'italic',  // 斜体
            'underline',  // 下划线
            'strikeThrough',  // 删除线
            'foreColor',  // 文字颜色
            'link',  // 插入链接
            'list',  // 列表
            'justify',  // 对齐方式
            'quote',  // 引用
            'image',  // 插入图片
            'table',  // 表格

            'undo',  // 撤销
            'redo'  // 重复
        ]
        editor.customConfig.uploadImgMaxSize = 10 * 1024 * 1024
        editor.customConfig.uploadImgTimeout = 30000
        editor.customConfig.uploadFileName = 'file'
        editor.customConfig.uploadImgServer = '{:url("file/uploadedit",["type"=>"image"])}';
        editor.customConfig.zIndex = 100;
        editor.customConfig.onchange = function (html) {
            $('#newinfo').html(html)
        }
        editor.create()
    });
</script>






